<template>
	<view>
		<!-- #ifdef MP-WEIXIN -->
		<navbar  title="实名认证" :isGoBack="true" :isNotice="true" :visible="true" :bgColor="bgColor" :btnColors='btnColor' ></navbar>
		<!-- #endif -->	
		<view class="p-20">
		  <view class="about">
		    <view class="about-header" v-if="userInfo.is_auth == 0">
		      <image class="about-header__image" src="https://image.tea-milk.site/2024-10-09/c01220de5c059207856e1428cf8a31c6.png"></image>
		      <view class="norealname">暂未实名</view>
			  <!-- <view class="realname_info">实名认证需要真实信息</view> -->
			   <view class="">
				    <navigator open-type="navigate" url="./auth">
			   	      <button class="about-button" style="background:#36B3E9;"   @click="doauth">立即认证</button>
					</navigator>
			   </view>
		    </view>
		<!-- 	<view class="about-header" v-if="userInfo.is_auth == 1">
				<image class="about-header_auth" src="https://image.tea-milk.site/2024-10-09/02840406a53a289da872e8ed49546be1.png"></image>
				<view class="authrealname">
					您已提交实名认证，审核中~
				</view>
				<view class="" style="margin-top: 55rpx;" @click="backgo()">
					<u-button type="primary" :plain="true" shape="circle" text="返回" size="small" style="width: 120rpx;"></u-button>					
				</view>				
			</view> -->
			<view class="about-header" v-if="userInfo.is_auth == 2">
				<image class="about-header_auth" src="https://image.tea-milk.site/2024-10-09/02840406a53a289da872e8ed49546be1.png"></image>
				<view class="authrealname">
					您信息审核被驳回，请重新提交~
				</view>
				<view class="" style="margin-top: 55rpx;">
					<navigator open-type="navigate" url="./auth">
					  <u-button type="primary" :plain="true" shape="circle" text="请重新提交" size="small" style="width: 120rpx;"></u-button>	
					</navigator>
				</view>				
			</view>
			<view class="about-header header_auth" v-if="userInfo.is_auth == 1">
			   <view class="flex flex-direction justify-center align-center text-center">
			   	   <text  style="margin-top: 60rpx;font-size: 32rpx;color: #fff;font-weight: bold;">您已实名认证</text>
				   <text  style="margin-top: 40rpx;font-size: 32rpx;color: #fff;">{{userInfo.realname}}</text>
				   <text  style="margin-top: 40rpx;font-size: 28rpx;color: #fff;margin-bottom: 60rpx;">{{userInfo.idcard}}</text>
			   </view>
			</view>
		   <view class="about-content">
		      <view>身份信息我们将严格保密，仅用于验证我们提供的业务</view>
		    </view>
		  </view>
		</view>
	</view>	 
</template>

<script>	
	export default {
		data () {
			return {
				...getApp().globalData.config,
				username:"",
				list:{},
				userInfo:{},
				customStyle: {
					marginTop: '20px', // 注意驼峰命名，并且值必须用引号包括，因为这是对象
					color: 'red',
					with:'120rpx',
				}
			}			
		},
		onShow() {
		    let user_info=uni.getStorageSync('userInfo');
		    console.log('user_info',user_info)
		    let that=this;
		    if(user_info){
		    	let obj_data={
		    		token:user_info.token,
		    	    login_type:'app'
		    	};
		    	this.$http.getUser(obj_data).then(res=>{				
		    		if(res.resCode=='9999'){
		    			uni.setStorageSync('userInfo',res.data);	
		    		    that.userInfo=res.data
		    		}				
		    	})				
		    };		
		},
		onUnload () {
		    /*关闭所有页，打开url指定页面*/
		    uni.switchTab({
		      url: '/pages/mine/index'
		    })		   
		},
		methods:{	
			backgo(){
				this.$routers.router('/pages/mine/index','switchTab') 
			}
		
		},
	}
</script>

<style>
	page{
		background: #F0F9FE;
	}
	.u-button--plain.u-button--primary.data-v-3bf2dba7 {
	  color: #011F37 !important;
	}
	.u-button--primary.data-v-3bf2dba7 {
		border-color: #7c8389 !important;
	}
	.u-button--small.data-v-3bf2dba7 {
	    min-width: 110px !important;
	    height: 38px !important;
	    padding: 0px 8px;
	    font-size: 12px;
	}
	button::after{
		border: none;
		
	}
	.realname_info{
		margin-top: 20rpx;
		width: 509rpx;
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(5, 30, 56, 0.6);
		line-height: 50rpx;
	}
	.norealname{
		font-weight: 400;
		font-size: 40rpx;
		color: #011F37;
		line-height: 32rpx;
		margin-top: -320rpx;
	}
	
	.authrealname{
		font-weight: 400;
		font-size: 40rpx;
		color: #011F37;
		line-height: 32rpx;
		margin-top: 30rpx;
	}
	/* pages/mine/about/index.wxss */
	.about{
	  /* background: white; */
	  /* padding: 10rpx 20rpx;
	  height: 1000rpx; */
	}
	
	.about-header{
	  margin-top: 80rpx;
	  display: flex;
	  flex-direction: column;
	  align-items: center;
	  justify-content: center;
	}
	
	.about-header__image{
	  height: 625rpx;
	  width: 580rpx;
	  display: block;
	 /* background: rgb(216, 216, 216); */
	}
	
	.header_auth{
		width: 702rpx;
		height: 332rpx;
		background: linear-gradient( 134deg, #36B3E9 0%, #2ACBD8 100%);
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		/* background-image: url('https://image.tea-milk.site/2024-10-09/270901087a62c45ca9c999189732abfd.png');
		background-repeat: no-repeat;
		background-size: 100% 100%; */
	}
	
	.about-header_auth{
		width: 260rpx;
		height: 260rpx;
		display: block;
	}
	
	.about-header__text{
	  font-size: 28rpx;
	  padding: 10rpx 0 30rpx 0;
	  color: #666666;
	}
	
	.about-content{
	  display: flex;
	  position: absolute;
	  bottom: 40rpx;
	  color: #666666;
	  font-size: 24rpx;
	  line-height: 50rpx;
	  left: 90rpx;
	  
	}
	
	.about-button{
	  margin-top: 40rpx;
	  font-size: 28rpx;
	  line-height: 80rpx;
	  width: 218rpx;
	  height: 83rpx;
	  color: #FFFFFF;
	  border-radius: 37rpx;
	}
	
	.about-button:active{
	  opacity: 0.5;
	}
</style>